import Vue from 'vue'
import resource from 'vue-resource'
import App from './App'
import store from './vuex'
import router from './router'
import utils from './utils'
import httpapi from './api'
import components from './components'
import Element from 'element-ui';
import './assets/scss/app.scss';
import 'element-ui/lib/theme-chalk/index.css';
import vuescroll from 'vue-scroll'
import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'
import './utils/auth'

Object.keys(components).forEach(k => {
    var a = Vue.component(k, components[k]);
})

Object.keys(utils).forEach(k => {
    Vue.prototype[`\$${k}`]=utils[k];
})
process.env.NODE_ENV === 'production'||process.env.NODE_ENV === 'testing'?Vue.prototype.$origin=window.origin:Vue.prototype.$origin='http://192.168.0.110';
Vue.config.productionTip = false
Vue.use(resource);
Vue.use(Element);
Vue.use(vuescroll);
Vue.use(httpapi,router);
Vue.use(contentmenu);

new Vue({
	el: '#app',
	router,
	store,
	template: '<App/>',
	components: {
		App
	}
})
